package com.sql.compare.controller;

import com.sql.compare.dto.ResultDTO;
import com.sql.compare.entity.SqlCompare;
import com.sql.compare.service.SqlCompareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 数据对比api
 */
@RestController
@RequestMapping("/sql-compare")
public class SqlCompareController {
    @Autowired
    private SqlCompareService sqlCompareService;

    @PostMapping("/databaseCompare")
    public ResultDTO<String> databaseCompare(@RequestBody SqlCompare sqlCompare) {
        return sqlCompareService.databaseCompare(sqlCompare);
    }

    @PostMapping("/tableCompare")
    public ResultDTO<String> tableCompare(@RequestBody SqlCompare sqlCompare) {
        return sqlCompareService.tableCompare(sqlCompare);
    }

    @PostMapping("/indexCompare")
    public ResultDTO<String> indexCompare(@RequestBody SqlCompare sqlCompare) {
        return sqlCompareService.indexCompare(sqlCompare);
    }


    @PostMapping("/contentCompare")
    public ResultDTO<String> contentCompare(@RequestBody SqlCompare sqlCompare) {
        return sqlCompareService.contentCompare(sqlCompare);
    }



}
